import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { CommandSender } from '../commandHelper';

type SendUserCmd = CommandSender<any, any> | null;

// 1. 先按原来的方式定义Store（完全不变）
export const useHelpStore = defineStore('helpInjection', () => {
  const sendHelpCmd = ref<SendUserCmd>(null);

  const setInjections = (injections: { sendHelpCmd?: SendUserCmd }) => {
    if (injections.sendHelpCmd) {
      sendHelpCmd.value = injections.sendHelpCmd;
    }
  };

  return { sendHelpCmd, setInjections };

});